package cn.kai.process.flow.core;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * node上下文
 Author: cKnight
 Date: 2025/1/23
 */
public class NodeContext {
    /** 上下文数据 */
    private Map<String,Object> data  = new ConcurrentHashMap<>();

    public void setData(String key,Object value ){
        data.put(key,value);
    }

    public Object getData(String key){
        return data.get(key);
    }

    public Map<String,Object> getAllData(){
        return new HashMap<>(data);
    }
}
